#!/bin/bash
# H.265文件加密完整示例

echo "=== H.265文件加密完整流程 ==="

# 检查是否已编译
if [ ! -f "bin/encrypt" ] || [ ! -f "bin/decrypt" ] || [ ! -f "bin/keygen" ]; then
    echo "编译程序..."
    make
fi

echo "1. 使用加密程序直接生成密钥文件（推荐方式）"
echo "   运行命令：./bin/encrypt"
echo "   按提示输入："
echo "   - 是否使用密码: 1"
echo "   - 密码: 19880605"
echo "   - 输入文件: stream_chn0.h265"
echo "   - 输出文件: stream_chn0.h265.test"
echo "   - 密钥文件: stream_chn0.key"
echo ""

echo "2. 或者先单独生成密钥文件"
echo "   运行命令：./bin/keygen"
echo "   按提示输入："
echo "   - 是否使用密码: 1"
echo "   - 密码: 19880605"
echo "   - 密钥文件路径: stream_chn0.key"
echo ""

echo "3. 解密文件"
echo "   运行命令：./bin/decrypt"
echo "   按提示输入："
echo "   - 加密文件: stream_chn0.h265.test"
echo "   - 解密文件: stream_chn0_decrypted.h265"
echo "   - 密钥文件: stream_chn0.key"
echo "   - 是否使用密码: 1"
echo "   - 密码: 19880605"
echo ""

echo "现在您可以选择运行对应的程序了！"